Skip to content

Variant#14

Open
Meranolean wants to merge 8 commits intomasterfrom
variant
Open

Variant#14
Meranolean wants to merge 8 commits intomasterfrom
variant

Conversation

@Meranolean
Copy link
Owner

No description provided.

@Meranolean Meranolean closed this Jun 13, 2021
@Meranolean Meranolean reopened this Jun 13, 2021
@Meranolean Meranolean closed this Jun 13, 2021
@Meranolean Meranolean reopened this Jun 13, 2021
@Meranolean Meranolean closed this Jun 13, 2021
@Meranolean Meranolean reopened this Jun 13, 2021
}
};

const static std::size_t kNotFound = -1;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. std::size_t -> size_t
  2. инициализацию делаем через {} и тут это правило помогает

Если сделать:

const static std::size_t kNotFound{-1};

то будет error: narrowing conversion of '-1' ( будет overflow -1 пишем в unsigned), и мы понимаем, что надо сделать

const static int16_t kNotFound{-1};

@Meranolean Meranolean closed this Jun 14, 2021
@Meranolean Meranolean reopened this Jun 14, 2021
@Meranolean Meranolean closed this Jun 14, 2021
@Meranolean Meranolean reopened this Jun 14, 2021
@Meranolean Meranolean closed this Jun 14, 2021
@Meranolean Meranolean reopened this Jun 14, 2021
@Meranolean Meranolean closed this Jun 14, 2021
@Meranolean Meranolean reopened this Jun 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants